home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98a.txt
/
000134_icon-group-sender _Mon Mar 16 08:02:19 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id IAA19538
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 16 Mar 1998 08:02:18 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA18581; Mon, 16 Mar 1998 08:02:18 -0700
From: gep2@computek.net
Date: Fri, 13 Mar 1998 21:13:47 -0600
Message-Id: <199803140313.VAA32085@axp.cmpu.net>
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Subject: Re: Letter Probabilities
To: icon-group@optima.CS.Arizona.EDU
X-Mailer: SPRY Mail Version: 04.00.06.17
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 1445
> (1) Some letters occur with vanishingly small, but nonzero,
probabilities. In order to handle them, the generator string would have
to be extremely long just to have the letter occur once or twice in the
string! We are talking about several thousand characters in a string.
Yes. The string will be long according to the resolution of the probabilities
you wish to achieve. I would imagine, however, that a string of 1K-20K
characters in length would easily achieve the probability resolution you desire.
> (2) There is a more elegant Icon syntax for producing a random character
from a string, namely ?string. I assume that this operator assumes
equal probability for each letter in the string, namely 1/N where N =
*string.
Right, and I'd start by using that one. If you decide that the built-in random
number generator is insufficiently random for your purposes, you can of course
later substitute whatever other generator you like and explicitly index into the
string using the random subscript.
> When I
first rejected the idea, it was because I had the impression that Icon
could not handle strings of more that 255 characters. That appears not
to be the case.
It certainly is not the case. :-) You can have strings of nearly any
reasonable length (in fact, up to quite UNreasonable lengths). :-)
Gordon Peterson
http://www.computek.net/public/gep2/
Support the Anti-SPAM Amendment! Join at http://www.cauce.org/